[IA64] Switch to VPS save/restore for HVM
authorAlex Williamson <alex.williamson@hp.com>
Mon, 10 Mar 2008 17:50:59 +0000 (11:50 -0600)
committerAlex Williamson <alex.williamson@hp.com>
Mon, 10 Mar 2008 17:50:59 +0000 (11:50 -0600)
Replace pal_vp_save/restore with vps_save/restore.
The latter have better performance.

Signed-off-by: Anthony Xu <anthony.xu@intel.com>
xen/arch/ia64/vmx/vmx_init.c
xen/include/asm-ia64/vmx_pal_vsa.h

index 98eed43c4d54ac7b9db6a03997ab927526bf7ebe..c279595b8fae662b17aa354f4481f54b69be9a57 100644 (file)
@@ -52,6 +52,7 @@
 #include <xen/event.h>
 #include <asm/vlsapic.h>
 #include <asm/vhpt.h>
+#include <asm/vmx_pal_vsa.h>
 #include "entry.h"
 
 /* Global flag to identify whether Intel vmx feature is on */
@@ -308,12 +309,8 @@ vmx_save_state(struct vcpu *v)
        u64 status;
 
        BUG_ON(v != current);
-       /* FIXME: about setting of pal_proc_vector... time consuming */
-       status = ia64_pal_vp_save((u64 *)v->arch.privregs, 0);
-       if (status != PAL_STATUS_SUCCESS){
-               panic_domain(vcpu_regs(v),"Save vp status failed\n");
-       }
-
+       
+       ia64_call_vsa(PAL_VPS_SAVE, v->arch.privregs, 0, 0, 0, 0, 0, 0);
 
        /* Need to save KR when domain switch, though HV itself doesn;t
         * use them.
@@ -332,17 +329,12 @@ vmx_save_state(struct vcpu *v)
 void
 vmx_load_state(struct vcpu *v)
 {
-       u64 status;
-
        BUG_ON(v != current);
 
        vmx_load_all_rr(v);
 
        /* vmx_load_all_rr() pins down v->arch.privregs with both dtr/itr*/
-       status = ia64_pal_vp_restore((u64 *)v->arch.privregs, 0);
-       if (status != PAL_STATUS_SUCCESS){
-               panic_domain(vcpu_regs(v),"Restore vp status failed\n");
-       }
+       ia64_call_vsa(PAL_VPS_RESTORE, v->arch.privregs, 0, 0, 0, 0, 0, 0);
 
        ia64_set_kr(0, v->arch.arch_vmx.vkr[0]);
        ia64_set_kr(1, v->arch.arch_vmx.vkr[1]);
index 7ce80695010ce2369c644b32878f460a656f5181..612f5ab0b06ffb638484263aa883782b4acfe638 100644 (file)
@@ -38,6 +38,8 @@ extern u64 __vsa_base;
 #define PAL_VPS_SET_PENDING_INTERRUPT       0x1000
 #define PAL_VPS_THASH               0x1400
 #define PAL_VPS_TTAG                0x1800
+#define PAL_VPS_RESTORE             0x1c00
+#define PAL_VPS_SAVE                0x2000
 
 #endif /* _PAL_VSA_H_ */